package player;

import java.util.ArrayList;

import gameObjects.Card;
import gameObjects.CardTable;

public class Player {

	private Hand hand;
	private int playerID;
	private String playerName;
	private CardTable table;
	private float posX;
	private float posY;

	public Player(int _playerID, String _playerName, CardTable _table) {
		playerID = _playerID;
		playerName = _playerName;
		table = _table;
		hand = new Hand(playerID, table);
		table.addPlayer(this);
//		table.addActor(hand);
		// TODO Auto-generated constructor stub
	}

	public int getPlayerID() {
		return playerID;
	}

	public Hand getHand() {

		return hand;
	}
	
	public ArrayList<Card> getPlayerCards(){
		return hand.getCards();
	}
	
	public void addCard(Card _card){
//		if(playerID >0)
//			_card.showBack(true);
		table.addActor(_card);
		hand.addCard(_card);
		
	}
	public void removeCard(Card _card){
		hand.removeCard(_card);
	}

	public float getX(){return posX;}

	public float getY(){return posY;}
	
	public void setPosition(float _posX, float _posY) {
//		hand.remove();
//		hand.setOrigin(0, 0);
//		hand.setPosition(posX, posY);
//		table.addActor(hand);
		posX = _posX;
		posY = _posY;

	}
}
